import Qt 4.7
Item {
    id: popup
    property string text: ""

    y:-100; z: 100
    width: 750; height: 80
    parent: main
    anchors.horizontalCenter: parent.horizontalCenter

    BorderImage {
        anchors.fill: parent
        source: "button_generic.sci"
    }

    Text {
        anchors.centerIn: parent
        text: parent.text
        font.pixelSize: 23;
        color: "#8b0000";
    }

    states: State {
        name: "show"
        PropertyChanges { target:popup; y:200 }
    }

    transitions: [
    Transition {
        from: ""; to: "show"
        SequentialAnimation {
            PropertyAnimation { properties: "y"; from:-100; duration: 1000; easing.type: "OutBounce";}
            PauseAnimation { duration: 2000 }
            ScriptAction { script: popup.state=""; }
        }

    },
    Transition {
        from: "show"; to: ""
        PropertyAnimation { properties: "y"; to:500; duration: 300; easing.type: "InCubic";}
    }
    ]

    function show (text) {
        popup.text = text;
        timer.running = true;
    }

    function cancel() {
        timer.running = false;
    }

    Timer {
      id: timer
      interval: 300; running: false; repeat: false
      onTriggered: popup.state = "show"
    }
}